<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        .box{
            font-size: 32px;
            border-bottom: solid 1rem #f2f2f2;
            margin-bottom: 2rem;
        }
        span{
            font-size: 18px;
        }
        .sub >span{
            vertical-align: sub;
        }
        .super >span{
            vertical-align: super;
        }
        
        .baseline{
            vertical-align: baseline;
        }
        .baseline >b{
            font-size: 40px;
        }
        .baseline >span{
            font-size: 80px;
        }
    </style>
</head>
<body>
    <h1>vertical-align</h1>
    <h2>sup</h2>
    <div class="box sub">
        H<span>2</span>O
    </div>

    <h2>super</h2>
    <div class="box super">
        X<span>2</span> + Y<span>2</span>
    </div>

    <h2>baseline</h2>
    <div class="box baseline">
       <b>Y</b><span>X</span>
    </div>

    
</body>
</html>